<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<script type="text/javascript">
	$(function() {
		validReg("updateForm");
	});
</script>
<div id="page-content" class="page-content">


	<div class="page-content-wrapper">
		<div class="page-content">
			<!--content-->
			<div class="containerTop">
				<a href="javascript:;" class="a-back" onclick="menuFullUrl('menu/tree/page');"><span class="icon-back"></span></a>
				<span>修改权限</span>
			</div>

			<div class="panel charger">
				<form id="updateForm" class="form-horizontal" role="form"
					onsubmit="return validateCallback(this, menu.update);">
					<input type="hidden" name="id" class="form-control"
						value="${result.data.id }">

					<div class="form-group">
						<label class="col-sm-2 control-label"><span
							class="col_red">*</span>权限名称：</label>
						<div class="col-sm-10 ">
							<div class="pr">
								<input type="text" name="name" class="form-control"
									placeholder="请输入权限名称" required data-bv-notempty
									value="${result.data.name }" data-bv-stringlength-max="50"  data-bv-stringlength="true">
							</div>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label"><span
							class="col_red">*</span>父权限：</label>
						<div class="col-sm-10">
							<div class="pr">
								<select id="parentId" name="parentId" ></select>
							</div>
						</div>
					</div>
					
					<script type="text/javascript">
					    menu.addItem("parentId", "${result.data.parentId }");
					</script>

					<div class="form-group">
						<label class="col-sm-2 control-label"><span
							class="col_red">*</span>code：</label>
						<div class="col-sm-10">
							<div class="pr">
								<input type="text" name="code" class="form-control" disabled="disabled"
									placeholder="请输入code" value="${result.data.code }" required
									data-bv-notempty data-bv-stringlength-max="50"  data-bv-stringlength="true">
							</div>
						</div>
					</div>
					<div class="form-group">
						<label  class="col-sm-2 control-label">icon：</label>
						<div class="col-sm-10">
							<div class="pr">
								<input type="text" name="icon" class="form-control" placeholder="请输入icon地址" 
								   value="${result.data.icon }"  data-bv-stringlength-max="500"  data-bv-stringlength="true">
							</div>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">uri：</label>
						<div class="col-sm-10">
							<div class="pr">
								<input type="text" name="uri" class="form-control"
									placeholder="请输入uri" value="${result.data.uri }"
									data-bv-notempty data-bv-stringlength-max="500"  data-bv-stringlength="true">
							</div>
						</div>
					</div>
					<div class="form-group">
								<label  class="col-sm-2 control-label"><span class="col_red">*</span>类型：</label>
								<div class="col-sm-10">
									<div class="pr">
										<select id="resType" name="resType" >
										   <option value="1" <c:if test="${result.data.resType == 1 }"> selected="selected"</c:if>>菜单</option>
										   <option value="2" <c:if test="${result.data.resType == 2 }"> selected="selected"</c:if>>按钮</option>
										</select>
									</div>
								</div>
							</div>
							<div class="form-group">
								<label  class="col-sm-2 control-label"><span class="col_red">*</span>排序：</label>
								<div class="col-sm-10">
									<div class="pr">
										<input type="text"  name="sort" value="${result.data.sort }"  class="form-control" placeholder="请输入排序" required 
										pattern="^[\d]+$" data-bv-regexp-message="请输入数字"/> 
									</div>
								</div>
							</div>
					
					<div class="form-group">
						<label class="col-sm-2 control-label">备注：</label>
						<div class="col-sm-10">
							<div class="pr">
								<input type="text" name="note" class="form-control"
									placeholder="请输入备注" value="${result.data.note }" required
									data-bv-notempty data-bv-stringlength-max="500"  data-bv-stringlength="true">
							</div>
						</div>
					</div>
					<div class="text-center opareBtm">

						<button type="submit"  class="a-btn1">确定</button>
						<button type="button" onclick="menuFullUrl('menu/tree/page');"
							class="a-btn1 grey">返回</button>

					</div>


				</form>
			</div>

			<!--end content-->
			<div class="clearfix"></div>
		</div>
	</div>
</div>